package Practice;

import java.util.Scanner;

public class Keyboard {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();

        int count = 0;
        for (int i = 0; i < n - 1; i++) {
            if (s.charAt(i) == 'V' && s.charAt(i + 1) == 'K') {
                count++;
            }
        }
        int maxCount = count;

        // 尝试改变一个字符来增加"VK"的数量
        for (int i = 0; i < n; i++) {
            // 替换当前字符为'V'或'K'，看是否能增加"VK"的数量
            String temp1 = s.substring(0, i) + (s.charAt(i) == 'V' ? "K" : "V") + s.substring(i + 1);
            int newCount1 = 0;
            for (int j = 0; j < n - 1; j++) {
                if (temp1.charAt(j) == 'V' && temp1.charAt(j + 1) == 'K') {
                    newCount1++;
                }
            }
            maxCount = Math.max(maxCount, newCount1);

        }
        System.out.println(maxCount);
    }
}
